package HomeWork.Chapter04;

/**
 * Enjoy programming!!!
 * Time: 2021/11/27 -  14:45
 */
import java.util.Scanner;
public class Discount {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        double price = input.nextDouble();
        System.out.print(price * discount(price));


    }

    /* 请在这里填写答案 */
    public static double discount(double n){
        if (n <500){
            return 1.0;
        }
        else if (n >= 500 && n <=1000){
            return 0.9;
        }
        else if (n >1000 && n <2000){
            return 0.85;
        }
        else if (n >= 2000){
            return 0.8;
        }
        else{
            return -1.0;
        }
    }
}